package com.example.testspringes.jiehun;

import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.apache.xmlbeans.impl.xb.xsdschema.Public;

import java.util.Date;
import java.util.concurrent.ArrayBlockingQueue;

/**
 * @Description: //TODO
 * @ProjectName: testspringes
 * @Package: com.example.testspringes.jiehun
 * @Author: FX
 * @CreateDate: 2019/4/11 13:55
 * @Version: 1.0
 * Copyright: Copyright (c) 2019
 */
public class Queue {

    public static ArrayBlockingQueue<String> queue = new ArrayBlockingQueue<>(1000);

    static {
        try {
            for(int i=0;i<730;i++){
                Date date = DateUtils.addDays(new Date(), i);
                String format = DateFormatUtils.format(date, "yyyy-MM-dd");
                queue.put(format);
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
            System.out.println("初始化队列异常");
        }
    }

}
